package com.d3works.apps.bpm.db.repo;

import com.d3works.apps.bpm.db.WkfInstance;
import com.d3works.apps.bpm.service.execution.WkfInstanceService;
import com.d3works.inject.Beans;

public class BpmWkfInstanceRepository extends WkfInstanceRepository {

  @Override
  public void remove(WkfInstance instance) {
    if (instance.getInstanceId() != null) {
      Beans.get(WkfInstanceService.class).deleteProcessInstance(instance.getInstanceId());
    }

    super.remove(instance);
  }
}
